package com.naiterui.ehp.bs.doctor.controller.inner;

import com.naiterui.ehp.bp.constants.SwaggerTag;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.naiterui.ehp.bp.support.exception.BaseExceptionCodes;
import com.naiterui.ehp.bp.support.exception.PublicService;
import com.naiterui.ehp.bp.support.exception.ResponseVO;
import com.naiterui.ehp.bp.utils.lang.ConfigUtil;
import com.naiterui.ehp.bs.doctor.utils.AdTencentCloudSdkUtil;

/**
 * @author zhoupeipei
 * @date 2019-06-14 15:10
 * @since 1.0.0
 */
@RequestMapping("ad/inner/access/tencent")
@RestController
@Api(tags = {SwaggerTag.DOCTOR + SwaggerTag.INNER_API + SwaggerTag.OTHER})
public class InnerTencentCloudAccessTokenController {

    private static String wbAppId = ConfigUtil.getString("tencent-cloud.ad.wbAppId");
    private static String wbAppKey = ConfigUtil.getString("tencent-cloud.ad.wbAppKey");

    @RequestMapping("refresh")
    public ResponseVO<Void> refreshAccessToken() {
        AdTencentCloudSdkUtil.refreshAccessToken(wbAppId, wbAppKey);
        return PublicService.returnResponseVO(BaseExceptionCodes.SUCCESS);
    }
}
